//前面学习了那么多，现在就结合前端，实现一个登录操作
package com.my.project.post_mybatis_login;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.java.Log;

import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
@Log
@WebServlet("/login")
public class Login extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getParameterMap().forEach((k, v) -> {
            System.out.println(k + ": " + Arrays.toString(v));
            //ParameterMap存储了Post请求所携带的表单数据，可以将其遍历查看浏览器发送了什么数据
        });

        //设置一下响应类型和编码
        response.setContentType("text/html;charset=UTF-8);
        //获取post请求携带的表单数据
        Map<String, String[]> map = request.getParameterMap();
        //判断表单是否完整
        if(map.con)
    }
}
